﻿@model Everynet.Models.ForgetPasswordModel
@using Recaptcha;
@{
    ViewBag.Title = "ForgetPassword";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div id="pageContainerMyacc">
<h2>Password Forget Request</h2>
<div id="divafterSuccess" class="displaynone"> <br /><br /> 
    Your password reset request has been processed and instructions for your password reset have been emailed to you.
    <br />   
    If you haven't recieved this email within 2 hours, please call the help desk for assistance to reset your password.
    <br /><br />
</div>

<div id="divBeforeSuccess">
<fieldset>
<p>Please use the email address specified when you signed up with EveryNet - this is the email address we use to send all of your account notifications and invoices to.</p>




<div id='loadingmessage' class="displaynone">
        <img src="../../Content/images/loading.gif" alt="" />
    </div>
   
@using (Ajax.BeginForm("ForgetPasswordMail", "signUp", new AjaxOptions
                {
                    HttpMethod = "POST",
                    LoadingElementId = "loadingmessage",
                    OnSuccess = "Success"
                   
                }))
{
  <div id="err" class="validation-summary-errors"></div>
  @Html.ValidationSummary()
 <div class="div60">
            <div class="txtboxes60">
                @Html.LabelFor(m => m.Email)*</div>
            <div>@Html.TextBoxFor(m => m.Email, new { @class = "checkvalidationemail" })
                <br />
                @Html.ValidationMessageFor(m => m.Email)
            </div>
        </div>
    <br />
     <div class="div60">
            <div class="txtboxes60">
             Enter the words you see in the box, in order and separated by a space.
               </div>
            <div> @Html.Raw(Html.GenerateCaptcha("captcha", "red"))
            </div>
                <br />
                 @Html.ValidationMessage("captcha")
            </div>
       
        <div>
            <div class="txtboxes">
            </div>
            <div class="div45">
                <input type="submit" value="Request"/></div>
        </div>
}
</fieldset>
</div>
</div>
 @section JavaScript
{
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#Topnavigation").hide();
    });

    function Success(ajaxContext) {
        if (ajaxContext == "1") {
            $("#divBeforeSuccess").hide();
            $("#divafterSuccess").show();
        }
        else if (ajaxContext == "2") {
            $("#err").html("<ul><li>Invalid Captcha</li></ul>");
            $("#err").show();
        }
        else if (ajaxContext == "3") {
            $("#err").html("<ul><li>Invalid Email ID</li></ul>");
            $("#err").show();
        }
    }
    </script>
    }
